package com.web44.springboot.config;

import com.web44.springboot.filter.HelloFilter;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.Arrays;

/**
 * @Title: FilterConfig
 * @Description:
 * @Auther: py
 * @Version: 1.0
 * @create 2024/2/29 15:21
 */
@Configuration
public class FilterConfig {

    @Bean
    public FilterRegistrationBean<HelloFilter> helloFilterFilterRegistrationBean() {
        FilterRegistrationBean<HelloFilter> registrationBean = new FilterRegistrationBean<>();
        registrationBean.setFilter(new HelloFilter());
        registrationBean.setUrlPatterns(Arrays.asList("/*"));
        return registrationBean;
    }
}
